<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">



  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">



  <meta name="google-site-verification" content="SOqsL8PexCDMo8ubmGTRngo5fAy0r6255DCMfRC5Bzg">














  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.2" rel="stylesheet" type="text/css">


  <meta name="keywords" content="shadowsocks,">








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.2">






<meta name="description" content="一直在使用 ShadowSocks 这把梯子，本身是极为不错的，平时极少拉稀摆带，关键时候从没认过怂。半年左右时间，一直相安无事。故事从大约两三个月前开始，忽然，梯子不好用，墙外的世界再度被隔离。后来在 dongua 推荐下试用蓝灯，世界敞亮大约一个多月，及至最近两周之前，蓝灯也开始不好用，从此再无梯子，搜索只能用回 sogou。 最初以为是 SS 协议和蓝灯的协议被功夫网封死，因为试过几次切换">
<meta name="keywords" content="shadowsocks">
<meta property="og:type" content="article">
<meta property="og:title" content="SS 的故障修复一例">
<meta property="og:url" content="http://i.am.simonkuang.com/post/host-switch-plus-changes-pac-config-silently/index.html">
<meta property="og:site_name" content="旷{&lt;i&gt;氏&lt;&#x2F;i&gt; }淇元">
<meta property="og:description" content="一直在使用 ShadowSocks 这把梯子，本身是极为不错的，平时极少拉稀摆带，关键时候从没认过怂。半年左右时间，一直相安无事。故事从大约两三个月前开始，忽然，梯子不好用，墙外的世界再度被隔离。后来在 dongua 推荐下试用蓝灯，世界敞亮大约一个多月，及至最近两周之前，蓝灯也开始不好用，从此再无梯子，搜索只能用回 sogou。 最初以为是 SS 协议和蓝灯的协议被功夫网封死，因为试过几次切换">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://i.am.simonkuang.com/post/host-switch-plus-changes-pac-config-silently/host-switch-plus-source-code.png">
<meta property="og:image" content="http://i.am.simonkuang.com/post/host-switch-plus-changes-pac-config-silently/host-switch-plus-ui.png">
<meta property="og:updated_time" content="2019-02-27T15:07:50.681Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="SS 的故障修复一例">
<meta name="twitter:description" content="一直在使用 ShadowSocks 这把梯子，本身是极为不错的，平时极少拉稀摆带，关键时候从没认过怂。半年左右时间，一直相安无事。故事从大约两三个月前开始，忽然，梯子不好用，墙外的世界再度被隔离。后来在 dongua 推荐下试用蓝灯，世界敞亮大约一个多月，及至最近两周之前，蓝灯也开始不好用，从此再无梯子，搜索只能用回 sogou。 最初以为是 SS 协议和蓝灯的协议被功夫网封死，因为试过几次切换">
<meta name="twitter:image" content="http://i.am.simonkuang.com/post/host-switch-plus-changes-pac-config-silently/host-switch-plus-source-code.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.2',
    sidebar: {"position":"right","display":"post","offset":12,"offset_float":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://i.am.simonkuang.com/post/host-switch-plus-changes-pac-config-silently/">





  <title>SS 的故障修复一例 | 旷{<i>氏</i> }淇元</title>
  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-45245769-1', 'auto');
  ga('send', 'pageview');
</script>





</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-right page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">旷{<i>氏</i> }淇元</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://i.am.simonkuang.com/post/host-switch-plus-changes-pac-config-silently/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Simon Kuang">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="http://upload.jianshu.io/users/upload_avatars/69775/1a6d1438fd5d.jpg?imageMogr/thumbnail/90x90/quality/100">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="旷{<i>氏</i> }淇元">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">SS 的故障修复一例</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2016-07-16T12:22:55+08:00">
                2016-07-16
              </time>
            

            

            
          </span>

          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/post/host-switch-plus-changes-pac-config-silently/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count disqus-comment-count" data-disqus-identifier="post/host-switch-plus-changes-pac-config-silently/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css"><p>一直在使用 ShadowSocks 这把梯子，本身是极为不错的，平时极少拉稀摆带，关键时候从没认过怂。半年左右时间，一直相安无事。故事从大约两三个月前开始，忽然，梯子不好用，墙外的世界再度被隔离。后来在 dongua 推荐下试用蓝灯，世界敞亮大约一个多月，及至最近两周之前，蓝灯也开始不好用，从此再无梯子，搜索只能用回 sogou。</p>
<p>最初以为是 SS 协议和蓝灯的协议被功夫网封死，因为试过几次切换 SS 的源，问题仍然存在。还是前天受老寇启发，他说他这么长时间都用 SS 是可以的，没有出现过问题，我一下子才想到可能是自己的环境有问题。</p>
<p>最终经过排查，发现是 chrome 的插件『<a href="https://chrome.google.com/webstore/detail/bopepoejgapmihklfepohbilpkcdoaeo" target="_blank" rel="noopener">Host Switch Plus 1.3.9</a>』有问题。在 chrome 的扩展管理里面禁用掉它之后，就能恢复梯子。而这是一个可以在 chrome 下面创建和切换 host 环境的插件。遥想当年 <a href="http://www.firefox.com.cn/" target="_blank" rel="noopener">FireFox</a> 的 <a href="https://addons.mozilla.org/en-US/firefox/addon/switchhosts/" target="_blank" rel="noopener">Host</a> 插件，真是让人怀念，所以当时一看到这个插件，我就装上了。没想到出了这么一个幺蛾子。</p>
<p>找到 Host Switch Plus 的源代码，发现在 <code>js/model.js</code> 中的第 346 行开始，有如下的代码。<img src="./host-switch-plus-source-code.png" alt="HostSwitchPlus 涉及修改 PAC 模式的源代码"></p>
<p>而在其功能界面，也明确提供了针对修改浏览器代理模式的功能。<img src="./host-switch-plus-ui.png" alt="HostSwitchPlus 修改浏览器 PAC 模式的界面"></p>
<p>众所周知，无论是 SS 还是蓝灯，抑或 SwitchyOmega 扩展等第三方工具，都是利用系统 PAC 机制实现科学上网功能的。HSP 修改 PAC 的时候，其实等于覆盖了 SS 及蓝灯的设置，当然导致无法再上网。并且，这种修改是覆盖式的，HSP 没有『恢复设置』一说，也就是说，一旦修改之后，无论你在 HSP 的界面将上网模式设置成『DIRECT』还是『SYSTEM』都不能正确翻墙。除非你在 chrome 的扩展管理界面中将 HSP 禁用或者卸载，让 chrome 帮你恢复系统的 PAC 设置。</p>
<p>PS：关于 SS 不能使用的问题，网上还有网友提到是因为<a href="https://www.lylinux.org/shadowsocks%E4%B8%8D%E8%83%BD%E4%BD%BF%E7%94%A8%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95.html" target="_blank" rel="noopener">迅雷的一个 DLL 文件作祟，以及迅雷默认端口与 SS 默认端口冲突所致</a>。Windows 下的朋友遇到的话，也可以检查一下这种情况。</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/shadowsocks/" rel="tag"># shadowsocks</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/post/loading-error-on-some-special-version-win7/" rel="next" title="Windows7 运行 VirtualBox 虚拟机的一则错误">
                <i class="fa fa-chevron-left"></i> Windows7 运行 VirtualBox 虚拟机的一则错误
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/post/cherish-an-ex-colleague/" rel="prev" title="致一位逝去的同事">
                致一位逝去的同事 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview sidebar-panel sidebar-panel-active">
        <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image" src="http://upload.jianshu.io/users/upload_avatars/69775/1a6d1438fd5d.jpg?imageMogr/thumbnail/90x90/quality/100" alt="Simon Kuang">
          <p class="site-author-name" itemprop="name">Simon Kuang</p>
           
              <p class="site-description motion-element" itemprop="description"></p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
            
              <a href="/archives/">
            
                <span class="site-state-item-count">41</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">17</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/simonkuang || github" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                    
                      GitHub
                    
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              友情链
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.laruence.com/" title="Laruence" target="_blank">Laruence</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html" title="agentzh的Nginx教程" target="_blank">agentzh的Nginx教程</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://danielkummer.github.io/git-flow-cheatsheet/index.zh_CN.html" title="gitflow-cheatsheet" target="_blank">gitflow-cheatsheet</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://my.oschina.net/yilian/blog/664632" title="TensorFlow入门教程" target="_blank">TensorFlow入门教程</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">
  
  &copy;  2005 &mdash; 
  <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Simon Kuang</span>

  
</div>


<script src="https://unpkg.com/mermaid@8.0.0/dist/mermaid.min.js"></script>
<script>
  if (window.mermaid) {
    mermaid.initialize({"startOnload":true});
  }
</script>



  <div class="powered-by">由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动</div>

  <span class="post-meta-divider">|</span>

  <div class="theme-info">主题 &mdash; <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.2</div>


        




  <script type="text/javascript">
    (function() {
      var hm = document.createElement("script");
      hm.src = "//tajs.qq.com/stats?sId=56218002";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.2"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.2"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.2"></script>



  


  

    
      <script id="dsq-count-scr" src="https://kuangqiyuan.disqus.com/count.js" async></script>
    

    
      <script type="text/javascript">
        var disqus_config = function () {
          this.page.url = 'http://i.am.simonkuang.com/post/host-switch-plus-changes-pac-config-silently/';
          this.page.identifier = 'post/host-switch-plus-changes-pac-config-silently/';
          this.page.title = 'SS 的故障修复一例';
        };
        var d = document, s = d.createElement('script');
        s.src = 'https://kuangqiyuan.disqus.com/embed.js';
        s.setAttribute('data-timestamp', '' + +new Date());
        (d.head || d.body).appendChild(s);
      </script>
    

  




	





  












  





  

  

  

  

  

  

</body>
</html>
